##########################################
#
# Copyright 2008 David B. Spadea
# All rights reserved
#
# http://www.spadea.net
#
# This program and all supporting code  
# is released under the terms of the 
# GNU General Public License version 3.
#
##########################################
package BatchTools::Database;

use Data::Dumper;

use BatchTools::Config;

use DBI;
use base qw(DBI);

sub new 
{
	my $class = shift;

	my $CONFIG = BatchTools::Config::getConfig();
	my $cfg = $$CONFIG{Database};

	my $dsn = sprintf("dbi:%s:host=%s;dbname=%s", 
			$$cfg{Driver}, $$cfg{Host}, $$cfg{DBName} );

	my $db = $class->connect($dsn, $$cfg{UserID}, $$cfg{Password})
		or warn ($DBI::errstr);

	return $db;
}

package BatchTools::Database::db;
use DBI;
use base qw(DBI::db);


package BatchTools::Database::st;
use DBI;
use base qw(DBI::st);


1;
